package com.uchiha.nova.core.feign;

import com.uchiha.nova.core.model.LogApi;
import com.uchiha.nova.core.model.LogError;
import com.uchiha.nova.core.model.LogUsual;
import com.uchiha.nova.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author 周林静
 * @Date 2021-10-25 15:14
 * @Version 1.0
 */
@FeignClient(name = "nova-logService",configuration= LogConfiguration.class,fallback = LogFeignFallback.class)
public interface ILogClient {

    String API_PREFIX = "/log";

    /**
     * 保存错误日志
     *
     * @param log
     * @return
     */
    @PostMapping(API_PREFIX + "/saveUsualLog")
    R<Boolean> saveUsualLog(@RequestBody LogUsual log);

    /**
     * 保存操作日志
     *
     * @param log
     * @return
     */
    @PostMapping(API_PREFIX + "/saveApiLog")
    R<Boolean> saveApiLog(@RequestBody LogApi log);

    /**
     * 保存错误日志
     *
     * @param log
     * @return
     */
    @PostMapping(API_PREFIX + "/saveErrorLog")
    R<Boolean> saveErrorLog(@RequestBody LogError log);

}
